<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="message" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="gotoPage('/psi/supplychainmana/CartogramChoice?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 主要信息 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="分类" prop="">
              {{message.client_class}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="供应商条形码" prop="">
              {{message.client_barcode}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="供应商类型" prop="">
              {{message.ctype}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="供应商名称" prop="">
              {{message.client_name}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="供应商等级" prop="">
              {{message.crate}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="网站地址" prop="">
              {{message.client_net}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="供应商行业" prop="">
              {{message.cbus}}
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 电话号码 </span>
      </div>
      <el-table :data="phones">
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="u_phones('&phones_id='+scope.row.phones_id+'')">设为主要</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="d_phone('&phones_id='+scope.row.phones_id+'')">删除</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
        <el-table-column label="类型" prop="description">
        </el-table-column>
        <el-table-column label="区号" prop="phone_area">
        </el-table-column>
        <el-table-column label="号码" prop="p_no">
        </el-table-column>
        <el-table-column label="分机号码" prop="phones_extension">
        </el-table-column>
      </el-table>
      <el-button @click="gotoPage('22610CD9838A497588AACA54D11C57B4?&cpopup=reload'+vueparams+'')" type='success' size="mini"><i class='fa fa-plus'></i>增加电话号码</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 电子邮件地址 </span>
      </div>
      <el-table :data="email">
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="u_email('&email_id='+scope.row.email_id+'')">设为主要</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="d_email('&email_id='+scope.row.email_id+'')">删除</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
        <el-table-column label="类型" prop="description">
        </el-table-column>
        <el-table-column label="邮件地址" prop="e_address">
        </el-table-column>
      </el-table>
      <div class="form-unit">
        <span class="mvc-title-left"> 即时通讯地址 </span>
      </div>
      <el-table :data="moment_info">
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="d_contact('&CMIDcontact_id='+scope.row.contact_id+'')">删除</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
        <el-table-column label="类型" prop="mccon">
        </el-table-column>
        <el-table-column label="信息" prop="mcno">
        </el-table-column>
        <el-table-column label="号码" prop="mc_no">
        </el-table-column>
      </el-table>
      <div class="form-unit">
        <span class="mvc-title-left"> 地址 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="地址类型" prop="">
              {{address.address_type}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="地区" prop="">
              {{address.address_nation}} 省 {{address.address_province}} 城市 {{address.address_city}} 县 {{address.address_town}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="邮政编码" prop="">
              {{address.address_postcode}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="详细地址" prop="">
              <div style="white-space: pre-wrap;">{{address.address_info}}</div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="地图" prop="">
              <baidu-map style="width:100%;height: 500px;" @ready="getMap"></baidu-map>
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 额外明细 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="备注" prop="">
              {{message.client_remark}}
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="gotoPage('/psi/sale/SupplierUp?'+vueparams+'')" type='success' size="mini"><i class='fa fa-edit'></i>修改</el-button>
      <el-button @click="gotoPage('2CB1709D05194080B7E5E97C60257191?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'CartogramDetil',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        message: {
          client_class: null,
          client_barcode: null,
          ctype: null,
          client_name: null,
          crate: null,
          client_net: null,
          cbus: null,
        },
        phones: [],
        email: [],
        moment_info: [],
        address: {
          address_type: null,
          address_nation: null,
          address_province: null,
          address_city: null,
          address_town: null,
          address_postcode: null,
          address_info: null,
          client_remark: null,
        },
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/supplychainmana/DeliveryAction/cartogramDetil?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
          this.mvc.loadMap(this.map, this.baidumap);
        })
      },
      getMap({
        BMap,
        map
      }) {
        this.map = map;
      },
    },
  }
</script>
